<?php
namespace Admin\Controller;

class VideoController extends CommonController {
    public function index(){
        $this->assign('title','视频管理');
        $list = M('video');
        $data = $list->select();
        $this->assign('data',$data);
        $this->show();
    }
    public function edit(){
        $info = M('video');
        $where['v_id'] = $_POST['v_id'];
        $re = $info->where($where)->save($_POST);
        echo json_encode($re);
    }
    public function d(){
        $video = M('video');
        $re = $video->delete($_POST['v_id']);
        echo json_encode(1);

    }
    public function add(){
        $video = M('video');
        $video->create();
        $re = $video->add();
        echo json_encode($re);
    }

}   